Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

147
Views
Cómo leer la primera línea del archivo csv y mostrar en el cuadro de texto | ápice de oráculo | JavaScript

He creado una aplicación en ORACLE APEX

Donde tengo el explorador de archivos, el cuadro de texto y el envío. cuando selecciono el archivo, su primera línea debe leerse y mostrarse en el cuadro de texto al hacer clic en el botón Enviar

 <!DOCTYPE html> <html> <body> <p>Choose file:</p> <input type="file" id="myFile" name="filename"> <input type="submit"> <br><br> <label for="fname">First line from csv file :</label> <input type="text" id="fname" name="fname"> </body> </html>

mi codigo js

 function confirmFileSubmit(){ var input = document.getElementById('fileUpload'); // get the input var file = input.files[0]; // assuming single file, no multiple var reader = new FileReader(); reader.onload = function(e) { var text = reader.result; // the entire file var firstLine = text.split('\n').shift(); // first line console.log(firstLine); // use the console for debugging } reader.readAsText(file, 'UTF-8'); // or whatever encoding you're using // UTF-8 is default, so this argument }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!